
package main

import (
	"fmt"
//	"reflect"
	"time"
)

type MyError struct{
	ErTime time.Time
	ErMsg string
}

func (e MyError)Error()string{
	return fmt.Sprint("MyError-> time:",e.ErTime," msg:",e.ErMsg)
}

func opr()error{
	return MyError{
		ErTime:time.Now(),
		ErMsg:"this is my error",
	}
}

func main(){
	fmt.Println("test errors")
	er:=opr()
	if er!=nil {
		fmt.Println("error info :",er)
	}
}